from mqtt_test import ccmqtt
from test.led import start_led

import network,time
from lib.umqtt.simple import MQTTClient

# import upip
# upip.install('micropython-umqtt.simple')
# pip install micropython-umqtt.simple

# micropython -m upip install micropython-pystone
# MicroPython中库的使用
# https://blog.csdn.net/sunlichao/article/details/87440392
def do_connect():
    import network
    sta_if = network.WLAN(network.STA_IF)
    if not sta_if.isconnected():
        print('connecting to network...')
        sta_if.active(True)
        sta_if.connect(b'\xe5\x8d\x83\xe5\x92\x8c', 'Aa3111103')
        while not sta_if.isconnected():
            pass
    print('network config:', sta_if.ifconfig())

do_connect()

ccmqtt("192.168.10.70") # 修改为相应的MQTT服务器地址
# import webcam
# webcam.run()
print('led started')
# start_led()


